<template>
  <div>
    <van-nav-bar
      :z-index="999"
      :fixed="true"
      left-arrow
      @click-left="onClickLeft"
      :placeholder="true"
      title="基础操作"
    ></van-nav-bar>
    <!-- 训练车型 -->
    <!-- <div class="training-model border-bottom">
      <p>训练车型</p>
      <div>捷达</div>
      <div>新桑塔纳</div>
      <div>爱丽舍</div>
    </div> -->
    <!-- 车列表 -->
    <div>
      <div class="panel-bd kd-video">
        <van-cell
          v-for="(item, i) in lists"
          :key="i"
          @click="href('/TeachingVideo', type, item.id)"
        >
          <template #icon>
            <div class="kd-photo">
              <img :src="item.picaddress" alt />
              <div class="iconfont van-icon-bofang"></div>
              <!-- <div class="kd-tm">02:33</div> -->
            </div>
          </template>
          <template #title>
            <div class="kd-title">{{ item.title }}</div>
            <div class="kd-attr">
              <!-- <div class="item"><van-icon name="like-o" />444</div> -->
              <div class="item"><van-icon name="video-o" />{{ item.djl }}</div>
            </div>
          </template>
        </van-cell>
      </div>
    </div>
  </div>
</template>

<script>
import { ExamVideo } from "../../assets/js/api/exam";
export default {
  name: "BasicOperation",
  data() {
    return {
      lists: [],
      type: ""
    };
  },
  created() {
    let dsBridge = require("dsbridge");
    dsBridge.call("goBack", "", function() {
      history.go(-1);
    });

    console.log(this.$route.params.type);
    this.type = this.$route.params.type;
    ExamVideo(this.$route.params.type, "2").then(res => {
      console.log(res);
      if (res.code == 0) {
        this.lists = res.data;
      }
    });
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
    href(url, type, stop) {
      this.$router.push({ path: url + "/" + type + "/" + stop });
    }
  }
};
</script>

<style></style>
